# -*- coding: utf-8; mode: snippet -*-
# name: ols, linear regression
# key: ols_lm@statsmodels
# key: linear_regression_ols@statsmodels
# contributor: Shuguang Sun
# --
# from scipy import stats
# import matplotlib.pyplot as plt
# import statsmodels.api as sm
# from statsmodels.formula.api import ols

${1:model} = '${2:height ~ C(type)}'
${3:results} = ols($1, data=${4:data}).fit()
$3.summary()

${4:influence} = $3.get_influence()
${5:studentized_residuals} = $4.resid_studentized_external
${6:res} = stats.probplot($5, plot=plt)
plt.show()

result = stats.anderson($5)
stat, p = stats.shapiro($5)